<?php
/**
 * Joomla! 1.5 component ArticleCashRewards
 *
 * @version $Id: tabs.php 2009-06-29 11:47:01 svn $
 * @author Maverick
 * @package Joomla.components.com_articlecashrewards
 * @subpackage views.mypage.tmpl
 * @link http://joomladev.boddunan.com
 * @license GNU/GPL
 *
 * Review and approve the articles and assign points and cash rewards.
 * Users can see their articles and the points/cash rewards assigned in the front-end module.
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

$dashboard_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=dashboard';
$dashboard_onclick='';
$dashboard_class = '';

$article_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=articles';
$article_onclick='';
$article_class = '';

$profile_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=profile';
$profile_onclick='';
$profile_class = '';

$weblinks_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=weblinks';
$weblinks_onclick='';
$weblinks_class = '';

$referrals_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=referrals';
$referrals_onclick='';
$referrals_class = '';

$layout = $this->getLayout();

switch ($layout) {
    case "myprofile":
        $dashboard_href = '#';
        $dashboard_onclick='onclick="return false;"';
        $dashboard_class = 'class="open"';
        
        $article_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=articles';
        $article_onclick='';
        $article_class = '';

        $profile_href = "index.php?option=com_articlecashrewards&controller=mypage&task=profile";
        $profile_onclick='';
        $profile_class = '';

        $weblinks_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=weblinks';
        $weblinks_onclick='';
        $weblinks_class = '';

        $referrals_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=referrals';
        $referrals_onclick='';
        $referrals_class = '';
        
        break;

    case "articles":
        $dashboard_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=dashboard';
        $dashboard_onclick='';
        $dashboard_class = '';
        
        $article_href = '#';
        $article_onclick='onclick="return false;"';
        $article_class = 'class="open"';

        $profile_href = "index.php?option=com_articlecashrewards&controller=mypage&task=profile";
        $profile_onclick='';
        $profile_class = '';

        $weblinks_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=weblinks';
        $weblinks_onclick='';
        $weblinks_class = '';

        $referrals_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=referrals';
        $referrals_onclick='';
        $referrals_class = '';

        break;

    case "paymentinfo":
        $dashboard_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=dashboard';
        $dashboard_onclick='';
        $dashboard_class = '';

        $article_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=articles';
        $article_onclick='';
        $article_class = '';

        $profile_href = '#';
        $profile_onclick='onclick="return false;"';
        $profile_class = 'class="open"';

        $weblinks_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=weblinks';
        $weblinks_onclick='';
        $weblinks_class = '';

        $referrals_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=referrals';
        $referrals_onclick='';
        $referrals_class = '';

        break;

    case "weblinks":
        $dashboard_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=dashboard';
        $dashboard_onclick='';
        $dashboard_class = '';

        $article_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=articles';
        $article_onclick='';
        $article_class = '';

        $profile_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=profile';
        $profile_onclick='';
        $profile_class = '';

        $weblinks_href = '#';
        $weblinks_onclick='onclick="return false;"';
        $weblinks_class = 'class="open"';

        $referrals_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=referrals';
        $referrals_onclick='';
        $referrals_class = '';

        break;

    case "referrals":
        $dashboard_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=dashboard';
        $dashboard_onclick='';
        $dashboard_class = '';

        $article_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=articles';
        $article_onclick='';
        $article_class = '';

        $profile_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=profile';
        $profile_onclick='';
        $profile_class = '';

        $weblinks_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=weblinks';
        $weblinks_onclick='';
        $weblinks_class = '';

        $referrals_href = 'index.php?option=com_articlecashrewards&controller=mypage&task=referrals';
        $referrals_onclick='onclick="return false;"';
        $referrals_class = 'class="open"';

        break;
}

$user =& JFactory::getUser();
$ruser = JRequest::getVar( 'uid', null, '', 'INTEGER');
?>
<a href="<?php echo $dashboard_href; ?>" <?php echo $dashboard_onclick; ?>>
<dl class="tabs">
    <dt <?php echo $dashboard_class; ?>>
        <span><?php echo JText::_('VIEW_DASHBOARD'); ?></span>
    </dt>
</dl>
</a>
<a href="<?php echo $article_href; ?>" <?php echo $article_onclick; ?>>
<dl class="tabs">
    <dt <?php echo $article_class; ?>>
        <span><?php echo JText::_('VIEW_ARTICLES_TITLE'); ?></span>
    </dt>
</dl>
</a>
<?php if($this->acr_config[CONFIG_ENABLE_WEBLINKS] == '1'){?>
<a href="<?php echo $weblinks_href; ?>" <?php echo $weblinks_onclick; ?>>
    <dl class="tabs">
        <dt <?php echo $weblinks_class; ?>>
            <span><?php echo JText::_('VIEW_WEBLINKS'); ?></span>
        </dt>
    </dl>
</a>
<?php } ?>
<?php if($this->acr_config[CONFIG_ENABLE_REFERRALS] == '1'){?>
<a href="<?php echo $referrals_href; ?>" <?php echo $referrals_onclick; ?>>
    <dl class="tabs">
        <dt <?php echo $referrals_class; ?>>
            <span><?php echo JText::_('VIEW_REFERRALS'); ?></span>
        </dt>
    </dl>
</a>
<?php } ?>
<?php if($ruser == null || $user->id==$ruser){?>
<a href="<?php echo $profile_href; ?>" <?php echo $profile_onclick; ?>>
    <dl class="tabs">
        <dt <?php echo $profile_class; ?>>
            <span><?php echo JText::_('VIEW_PROFILE'); ?></span>
        </dt>
    </dl>
</a>
<?php } ?>
